package com.ruoyi.contract.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.contract.mapper.ContractCategoryMapper;
import com.ruoyi.contract.domain.ContractCategory;
import com.ruoyi.contract.service.IContractCategoryService;

/**
 * 合同类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-18
 */
@Service
public class ContractCategoryServiceImpl implements IContractCategoryService 
{
    @Autowired
    private ContractCategoryMapper contractCategoryMapper;

    /**
     * 查询合同类别
     * 
     * @param contractCategoryId 合同类别主键
     * @return 合同类别
     */
    @Override
    public ContractCategory selectContractCategoryByContractCategoryId(Long contractCategoryId)
    {
        return contractCategoryMapper.selectContractCategoryByContractCategoryId(contractCategoryId);
    }

    /**
     * 查询合同类别
     *
     * @param belongingCompanyId 合同类别外键
     * @return 合同类别
     */
    public List<ContractCategory> selectContractCategoryByBelongingCompanyId(Long belongingCompanyId){

        return contractCategoryMapper.selectContractCategoryInfoByBelongingCompanyId(belongingCompanyId);
    }

    /**
     * 查询合同类别列表
     * 
     * @param contractCategory 合同类别
     * @return 合同类别
     */
    @Override
    public List<ContractCategory> selectContractCategoryList(ContractCategory contractCategory)
    {
        return contractCategoryMapper.selectContractCategoryList(contractCategory);
    }

    /**
     * 新增合同类别
     * 
     * @param contractCategory 合同类别
     * @return 结果
     */
    @Override
    public int insertContractCategory(ContractCategory contractCategory)
    {
        return contractCategoryMapper.insertContractCategory(contractCategory);
    }

    /**
     * 修改合同类别
     * 
     * @param contractCategory 合同类别
     * @return 结果
     */
    @Override
    public int updateContractCategory(ContractCategory contractCategory)
    {
        return contractCategoryMapper.updateContractCategory(contractCategory);
    }

    /**
     * 批量删除合同类别
     * 
     * @param contractCategoryIds 需要删除的合同类别主键
     * @return 结果
     */
    @Override
    public int deleteContractCategoryByContractCategoryIds(Long[] contractCategoryIds)
    {
        return contractCategoryMapper.deleteContractCategoryByContractCategoryIds(contractCategoryIds);
    }

    /**
     * 删除合同类别信息
     * 
     * @param contractCategoryId 合同类别主键
     * @return 结果
     */
    @Override
    public int deleteContractCategoryByContractCategoryId(Long contractCategoryId)
    {
        return contractCategoryMapper.deleteContractCategoryByContractCategoryId(contractCategoryId);
    }
}
